﻿using System;
using Microsoft.Practices.Composite.Events;
using Microsoft.Practices.Composite.Presentation.Commands;

namespace StockholmsStad.Windows.UI.Modules.WatchList.Models
{
    public class WatchListPresentationModel
    {
        public event EventHandler<DataEventArgs<WatchListPresentationModel>> Noticed;
        public DelegateCommand<object> NoticeCommand { get; private set; }

        public WatchListPresentationModel()
        {
            NoticeCommand = new DelegateCommand<object>(Notice);
        }

        #region Properties

        public bool ReadOnly { get; set; }
        public int HistoryId { get; set; }
        public int? TicketId { get; set; }
        public string Information { get; set; }
        public string ModifiedByUser { get; set; }
        public DateTime Date { get; set; }

        #endregion

        private void Notice(object obj)
        {
            OnNoticed(new DataEventArgs<WatchListPresentationModel>(this));
        }

        private void OnNoticed(DataEventArgs<WatchListPresentationModel> e)
        {
            var noticedHandler = Noticed;

            if (noticedHandler != null)
                noticedHandler(this, e);
        }
    }
}
